public class Ex4_44{
	public static void main(String[] args){
		final int NUM = 1000000;
		int count = 0;
		for (int i = 0; i < NUM; i++){
			double x = -1 + Math.random()*2;
			double y = -1 + Math.random()*2;
			//System.out.printf("%.2f, %.2f\n", x, y);
			if (x < 0 || x >= 0 && y >= 0 && y < 1-x) 
				count++;
		}
		System.out.printf("The probability is: %.3f\n", count*1.0/NUM);
	}
}